module.exports = app => {
  const mongoose = app.mongoose;
  const { ObjectId } = mongoose.Schema.Types;
  const Schema = mongoose.Schema;
  const RoleSchema = new Schema({
    userId: {
      type: ObjectId,
      required: true // 必填项
    },
    content: {
      type: Array
    },
    date: {
      type: Number,
      required: true
    },
    title: {
      type: String,
      required: true
    },
    chatId: {
      type: ObjectId,
      required: true
    },
    comments: {
      type: Array
    }
  });
  return mongoose.model("Collect", RoleSchema, "collect");
};
